<template>
  <!-- 布局 -->
  <div class="common-layout">
    <el-container>
      <el-header style="text-align: center; background-color: aqua;height: 100px;">
        <h2>喜气羊羊育种管理平台</h2>
        <div style="width: 220px;height: 100px;margin-top: -70px;float: right;">
          <img :src="form.Img" :alt="form.Img" style="width: 100px; height: 100px;float: left;">
          <div style="margin-top: 30px;"> 登录人:{{ form.name }}</div>
         
        </div>
      </el-header>
      <el-container>
        <el-aside width="200px">
          <el-menu style="background-color: rgb(38, 140, 213);color: black;" class="el-menu-vertical-demo"
            default-active="2" text-color="#000">
            <!-- 登录信息 -->
            <el-menu-item index="1" style="background-color: rgb(38, 140, 213);">
              <el-icon><icon-menu /></el-icon>
              <span @click="router.push({ name: 'Login' })">退出登录</span>
            </el-menu-item>

            <!-- 权限管理 -->
            <el-sub-menu index="2">
              <template #title>
                <el-icon>
                  <location />
                </el-icon>
                <span>权限管理</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="2-1" @click="router.push({ name: 'RolesView' })">角色设置</el-menu-item>
              </el-menu-item-group>
              <el-menu-item-group>
                <el-menu-item index="2-2" @click="router.push({ name: 'PermissionView' })">权限分配</el-menu-item>
              </el-menu-item-group>
              <el-menu-item-group>
                <el-sub-menu index="2-3">
                  <template #title>人员管理</template>
                  <el-menu-item index="2-3-1" @click="router.push({ name: 'UserAddView' })">增加人员</el-menu-item>
                  <el-menu-item index="2-3-2" @click="router.push({ name: 'UserListView' })">查看人员</el-menu-item>
                </el-sub-menu>
              </el-menu-item-group>
            </el-sub-menu>

            <!-- 组织管理 -->
            <el-sub-menu index="3">
              <template #title>
                <el-icon>
                  <location />
                </el-icon>
                <span>组织管理</span>
              </template>
              <el-menu-item-group>
                <el-sub-menu index="3-1">
                  <template #title>单位设置</template>
                  <el-menu-item index="3-1-1" @click="router.push({ name: 'Unit' })">单位设置-新增</el-menu-item>
                  <el-menu-item index="3-1-2" @click="router.push({ name: 'UnitList' })">单位设置-显示</el-menu-item>
                </el-sub-menu>
              </el-menu-item-group>
              <el-menu-item-group>
                <el-sub-menu index="3-2">
                  <template #title>部门设置</template>
                  <el-menu-item index="3-2-1" @click="router.push({ name: 'Department' })">部门设置-新增</el-menu-item>
                  <el-menu-item index="3-2-2" @click="router.push({ name: 'DepartmentList' })">部门设置-显示</el-menu-item>
                </el-sub-menu>
              </el-menu-item-group>
              <el-menu-item-group>
                <el-menu-item index="3-3" @click="router.push('/SheepFarmList')">羊场设置</el-menu-item>
              </el-menu-item-group>
              <el-menu-item-group>
                <el-menu-item index="3-4" @click="router.push({ name: 'BuildingList' })">栋舍管理</el-menu-item>
              </el-menu-item-group>
            </el-sub-menu>
           
            <!-- 耳标管理 -->
            <el-sub-menu index="4">
              <template #title>
                <el-icon>
                  <location />
                </el-icon>
                <span>耳标管理</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="4-1" @click="router.push('/MalePeriodicList')">种公期初</el-menu-item>
              </el-menu-item-group>
              <el-menu-item-group>
                <el-menu-item index="4-2" @click="router.push('/MalePeriodicAddView')">种公期初-新增</el-menu-item>
              </el-menu-item-group>
              <el-menu-item-group>
                <el-menu-item index="4-3" @click="router.push('/FemalePeriodicList')">种母期初</el-menu-item>
              </el-menu-item-group>
              <el-menu-item-group>
                <el-menu-item index="4-4" @click="router.push('/FemalePeriodicAddView')">种母期初-新增</el-menu-item>
              </el-menu-item-group>
              <el-menu-item-group>
                <el-menu-item index="4-5" @click="router.push('/ProgenyPeriodicList')">后裔期初</el-menu-item>
              </el-menu-item-group>
              <el-menu-item-group>
                <el-menu-item index="4-6" @click="router.push('/ProgenyPeriodicAddView')">后裔期初-新增</el-menu-item>
              </el-menu-item-group>
            </el-sub-menu>
          
            <!-- 生产管理 -->
            <el-sub-menu index="5">
              <template #title>
                <el-icon>
                  <location />
                </el-icon>
                <span>生产管理</span>
              </template>
              <el-menu-item-group>
                <el-sub-menu index="5-1">
                  <template #title>羊只档案</template>
                  <el-menu-item index="5-1-1" @click="router.push('/SheepFileListView')">羊只档案列表</el-menu-item>
                  <el-menu-item index="5-1-2">羊只档案详情</el-menu-item>

                  <el-menu-item
                    index="5-1-3"
                    @click="router.push('/SheepFileAddView')"
                    >种羊档案-新增</el-menu-item
                  >
                  <el-menu-item
                    index="5-1-4"
                    @click="router.push('/ProgenyFileAddView')"
                    >后裔档案-新增</el-menu-item
                  >
                </el-sub-menu>
              </el-menu-item-group>
              <el-menu-item-group>
                <el-sub-menu index="5-2">
                  <template #title>羊只转舍</template>
                  <el-menu-item index="5-2-1" @click="router.push({ name: 'SheepTransferAdd' })">羊只转舍-新增</el-menu-item>
                  <el-menu-item index="5-2-2" @click="router.push({ name: 'SheepTransferList' })">羊只转舍-显示</el-menu-item>
                </el-sub-menu>
              </el-menu-item-group>
              <el-menu-item-group>
                <el-sub-menu index="5-3">
                  <template #title>种母配种</template>
                  <el-menu-item index="5-3-1">种母配种-新增</el-menu-item>
                  <el-menu-item index="5-3-2"
                    @click="router.push({ name: 'SheepHybridizationSelect' })">种母配种-显示</el-menu-item>
                </el-sub-menu>
              </el-menu-item-group>
              <el-menu-item-group>
                <el-sub-menu index="5-4">
                  <template #title>种母妊检</template>
                  <el-menu-item index="5-4-1">种母妊检-新增</el-menu-item>
                  <el-menu-item index="5-4-2"
                    @click="router.push({ name: 'SheepPregnancySelect' })">种母妊检-显示</el-menu-item>
                </el-sub-menu>
              </el-menu-item-group>
              <el-menu-item-group>
                <el-sub-menu index="5-5">
                  <template #title>种母分娩</template>
                  <el-menu-item index="5-5-1">种母分娩-新增</el-menu-item>
                  <el-menu-item index="5-5-2"
                    @click="router.push({ name: 'SheepChildbirthSelect' })">种母分娩-显示</el-menu-item>
                </el-sub-menu>
              </el-menu-item-group>
              <el-menu-item-group>
                <el-sub-menu index="5-6">
                  <template #title>种母断奶</template>
                  <el-menu-item index="5-6-1">种母断奶-新增</el-menu-item>
                  <el-menu-item index="5-6-2" @click="router.push({ name: 'SheepWeaningSelect' })">种母断奶-显示</el-menu-item>
                </el-sub-menu>
              </el-menu-item-group>
              <el-menu-item-group>
                <el-sub-menu index="5-7">
                  <template #title>种母历史记录</template>
                  <el-menu-item index="5-7-1">种母历史记录-新增</el-menu-item>
                  <el-menu-item index="5-7-2"
                    @click="router.push({ name: 'SheepHistorySelect' })">种母历史记录-显示</el-menu-item>
                </el-sub-menu>
              </el-menu-item-group>
              <el-menu-item-group>
                <el-sub-menu index="5-8">
                  <template #title>羊羔断奶</template>
                  <el-menu-item index="5-8-1" @click="router.push({ name: 'LambWeaningAdd' })">羔羊断奶-新增</el-menu-item>
                  <el-menu-item index="5-8-2" @click="router.push({ name: 'LambWeaningList' })">羔羊断奶-显示</el-menu-item>
                </el-sub-menu>
              </el-menu-item-group>
              <el-menu-item-group>
                <el-sub-menu index="5-9">
                  <template #title>后裔转种</template>
                  <el-menu-item index="5-9-1" @click="router.push({ name: 'DescendentAdd' })">后裔转种-新增</el-menu-item>
                  <el-menu-item index="5-9-2" @click="router.push({ name: 'DescendentList' })">后裔转种-显示</el-menu-item>
                </el-sub-menu>
              </el-menu-item-group>
            </el-sub-menu>

            <!-- 育种管理 -->
            <el-sub-menu index="6">
              <template #title>
                <el-icon>
                  <location />
                </el-icon>
                <span>育种管理</span>
              </template>
              <el-menu-item-group>
                <el-sub-menu index="6-1">
                  <template #title>羊只称重</template>
                  <el-menu-item index="6-1-1" @click="router.push({ name: 'SheepWeighedAdd' })">羊只称重-新增</el-menu-item>
                  <el-menu-item index="6-1-2" @click="router.push({ name: 'SheepWeighedList' })">羊只称重-显示</el-menu-item>
                </el-sub-menu>
              </el-menu-item-group>
              <el-menu-item-group>
                <el-sub-menu index="6-2">
                  <template #title>体尺测定</template>
                  <el-menu-item index="6-2-1" @click="router.push({ name: 'BodyAdd' })">体尺测定-新增</el-menu-item>
                  <el-menu-item index="6-2-2" @click="router.push({ name: 'BodyList' })">体尺测定-显示</el-menu-item>
                </el-sub-menu>
              </el-menu-item-group>
              <el-menu-item-group>
                <el-sub-menu index="6-3">
                  <template #title>品相测定</template>
                  <el-menu-item index="6-3-1" @click="router.push({ name: 'AppearancesAdd' })">品相测定-新增</el-menu-item>
                  <el-menu-item index="6-3-2" @click="router.push({ name: 'AppearancesList' })">品相测定-显示</el-menu-item>
                </el-sub-menu>
              </el-menu-item-group>
            </el-sub-menu>
                
            <!-- 提示报表 -->
            <el-sub-menu index="7">
              <template #title>
                <el-icon>
                  <location />
                </el-icon>
                <span>提示报表</span>
              </template>
              <el-menu-item-group>
                <el-menu-item
                  index="7-1"
                  @click="router.push({ name: 'PendingPrompts' })"
                  >待配提示</el-menu-item
                >
              </el-menu-item-group>
              <el-menu-item-group>
                <el-menu-item index="7-2" @click="router.push({ name: 'Pregnancy' })">首次妊检提示</el-menu-item>
              </el-menu-item-group>
              <el-menu-item-group>
                <el-menu-item
                  index="7-3"
                  @click="router.push({ name: 'ParturitionList' })"
                  >分娩提示</el-menu-item
                >
                </el-menu-item-group>
            </el-sub-menu>
            <!-- 汇总报表 -->
            <el-sub-menu index="8">
              <template #title>
                <el-icon>
                  <location />
                </el-icon>
                <span>汇总报表</span>
              </template>
              <el-menu-item-group>
                <el-menu-item
                  index="8-1"
                  @click="router.push({ name: 'SheepReport' })"
                  >羊场存栏统计</el-menu-item
                >
                <el-menu-item
                  index="8-2"
                  @click="router.push({ name: 'SheepBeedTypeReport' })"
                  >羊场实时存栏</el-menu-item
                >
              </el-menu-item-group>
            </el-sub-menu>

            <!-- 采购销售 -->
            <el-sub-menu index="10">
              <template #title>
                <el-icon>
                  <location />
                </el-icon>
                <span>采购销售</span>
              </template>
              <el-menu-item-group>
                <el-sub-menu index="10-1">
                  <template #title>羊只采购</template>
                  <el-menu-item index="10-1-1" @click="router.push({ name: 'PurchaseSalesAdd' })">羊只采购-新增</el-menu-item>
                  <el-menu-item index="10-1-2" @click="router.push({ name: 'PurchaseSalesList' })">羊只采购-显示</el-menu-item>
                </el-sub-menu>
              </el-menu-item-group>
              
            </el-sub-menu>
          </el-menu>
        </el-aside>
        <el-main>
          <RouterView />
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script setup lang="ts">
import { reactive } from 'vue';
import { useRouter } from 'vue-router'
const router = useRouter();
const form = reactive({
  Img :localStorage.getItem("userImg"),
  name:localStorage.getItem("userName")
})


</script>
<style scoped></style>